import Mock from "mockjs";
export default {
  getMenu: (config) => {
    const { username, password } = JSON.parse(config.body);
    // 先判断用户是否存在
    // 判断账号和密码是否对应
    if (username === "admin" && password === "admin") {
      return {
        code: 20000,
        data: {
          menu: [
            {
              path: "/home",
              name: "home",
              label: "首页",
              icon: "s-home",
              url: "home/index",
            },

            {
              label: "评论管理",
              icon: "document-remove",
              children: [
                {
                  path: "/reply",
                  name: "reply",
                  label: "评论管理",
                  icon: "place",
                  url: "reply/index",
                },
                {
                  path: "/replyEchart",
                  name: "replyEchart",
                  label: "购买占比",
                  icon: "place",
                  url: "reply/replyEchart",
                },
                {
                  path: "/replyOrder",
                  name: "replyOrder",
                  label: "订单发货",
                  icon: "place",
                  url: "reply/replyOrder",
                },
              ],
            },
            {
              path: "/mall",
              name: "mall",
              label: "商品管理",
              icon: "video-play",
              children: [
                {
                  path: "/mall/apple",
                  name: "apple",
                  label: "apple",
                  icon: "apple",
                  url: "Apple/Apple.vue",
                },
                {
                  path: "xiaomi",
                  name: "xiaomi",
                  label: "xiaomi",
                  icon: "goods",
                  url: "Mi/Mi.vue",
                },
              ],
            },
            {
              label: "数据统计",
              icon: "notebook-1",
              url: "/dataStatistics",
              children: [
                {
                  path: '/UserData',
                  name: 'UserData',
                  label: '用户数据',
                  icon: 'setting',
                  url: 'dataStatistics/UserData.vue',
                  children:[{
                    path: '/UserDataA',
                    name: 'UserDataA',
                    label: '用户数据的子页面1',
                    url: 'dataStatistics/UserDataA.vue',
                  },
                  {
                    path: '/UserDataB',
                    name: 'UserDataB',
                    label: '用户数据的子页面2',
                    url: 'dataStatistics/UserDataB.vue',
                  }]
                },
                {
                  path: "/VideoAnalytics",
                  name: "VideoAnalytics",
                  label: "视频分析",
                  icon: "setting",
                  url: "dataStatistics/VideoAnalytics",
                },
                {
                  path: "/Table",
                  name: "TableView",
                  label: "新增用户管理",
                  icon: "setting",
                  url: "dataStatistics/Table",
                },
              ],
            },
            {
              path: "/user",
              name: "user",
              label: "用户管理",
              icon: "user",
              url: "User/index",
            },
            {
              label: "订单管理",
              icon: "s-order",
              children: [
                {
                  path: "/order",
                  name: "order",
                  label: "订单管理",
                  icon: "s-order",
                  url: "order/index.vue",
                },
                {
                  path: "/order1",
                  name: "order1",
                  label: "补发退处理",
                  icon: "s-order",
                  url: "order/order.vue",
                },
                {
                  path: "/order2",
                  name: "order2",
                  label: "订单物流状态",
                  icon: "s-order",
                  url: "order/norm.vue",
                },
              ],
            },
            {
              label: "其他",
              icon: "question",
              children: [
                {
                  path: "/page2",
                  name: "page2",
                  label: "财务数据",
                  icon: "collection",
                  url: "other/pageTwo.vue",
                },
              ],
            },
            {
              label: "商品退款",
              icon: "paperclip",
              children: [
                {
                  path: "/page1",
                  name: "page1",
                  label: "退款用户",
                  icon: "truck",
                  url: "other/pageOne.vue",
                },

                {
                  path: "/pageOne2",
                  name: "pageOne2",
                  label: "允许发货区域",
                  icon: "truck",
                  url: "other/pageOne2.vue",
                },
              ],
            },
            {
              label: "设置",
              icon: "setting",

              children: [
                {
                  path: "/set/roles",
                  name: "roles",
                  label: "角色管理",
                  icon: "s-check",
                  url: "set/roles.vue",
                },
                {
                  path: "/set/operation",
                  name: "operationD",
                  label: "操作日志",
                  icon: "document",
                  url: "set/operation.vue",
                },
                {
                  path: "/set/security",
                  name: "securityS",
                  label: "安全设置",
                  icon: "warning",
                  url: "set/security.vue",
                },
                {
                  path: "/set/chart",
                  name: "chart",
                  label: "登录图表",
                  icon: "s-data",
                  url: "set/chart.vue",
                },
                {
                  path: "/set/security/change",
                  name: "changepassword",
                  // label: '修改密码',
                  // icon: 'edit',
                  url: "set/changepassword.vue",
                },
                {
                  path: "/set/security/modify",
                  name: "modifyphone",
                  url: "set/modifyphone.vue",
                },
                {
                  path: "/pageOne1",
                  name: "pageOne1",
                  // label: "退款数据",
                  // icon: "setting",
                  url: "other/pageOne1.vue",
                },
                {
                  path: 'shopdetails',
                  name: 'shopdetails',
                  url: 'Mi/shopDetails.vue'
                },
                {
                  path: 'mik60',
                  name: 'mik60',
                  url: 'Mi/mik60.vue'
                },
                {
                  path: 'xiaomi13',
                  name: 'xiaomi13',
                  url: 'Mi/xiaoM13.vue'
                },
                {
                  path: 'xiaomiwatchs2',
                  name: 'xiaomiwatchs2',
                  url: 'Mi/Xiaomiwatchs2.vue'
                },
                {
                  path: 'xiaomisoundpro',
                  name: 'xiaomisoundpro',
                  url: 'Mi/XiaomiSoundpro.vue'
                },
                {
                  path: 'xiaomibuds4',
                  name: 'xiaomibuds4',
                  url: 'Mi/Xiaomibuds4.vue'
                },
                {
                  path: 'miphone',
                  name: 'miphone',
                  url: 'Mi/Miphone.vue'
                },
                {
                  path: "/recovery",
                  name: "recovery",
                  url: "other/recovery.vue",
                },
              ],
            },
          ],
          token: Mock.Random.guid(),
          message: "获取成功",
        },
      };
    } else if (username === "xiaoxiao" && password === "xiaoxiao") {
      return {
        code: 20000,
        data: {
          menu: [
            {
              path: "/home",
              name: "home",
              label: "首页",
              icon: "s-home",
              url: "home/index",
            },
            {
              path: "/mall",
              name: "mall",
              label: "商品管理",
              icon: "video-play",
            },
          ],
          token: Mock.Random.guid(),
          message: "获取成功",
        },
      };
    } else {
      return {
        code: -999,
        data: {
          message: "密码错误",
        },
      };
    }
  },
};
